package eu.log;

import java.io.FileNotFoundException;
import eu.config.Config;
import eu.config.ConfigManager;
import eu.helper.RootPath;

public class ConfigGetter {
	private static Config config = null;
	
	static {
		//查找配置
		try {
			config = ConfigManager.loadConfigFile(RootPath.root+"eu.log.conf").getConfig("Log");
		} catch (FileNotFoundException e) {
			System.out.println("ConfigFile \"eu.log.conf\" not found, look for GlobalConfig");
			config=ConfigManager.getGlobalConfig("Log");
		}
	}

	public static Config getLogConfig() {
		return config;
	}

	public static String getParameter(String key) {
		if(config!=null)
			return config.getValueNE(key);
		return null;
	}

}
